package com.first.mapper;


import com.first.entity.CourseEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CourseMapper {

    @Select("select * from course")
    List<CourseEntity> getCourseList();

    @Insert("insert into course values (null,#{courseTime},#{courseNumber},#{courseHour})")
    void insertCourse(@Param("courseTime") String courseTime,@Param("courseNumber") Integer courseNumber,@Param("courseHour") Integer courseHour);

    @Delete("delete from course where id=#{id}")
    int deleteCourse(@Param("id") Integer id);

    @Update("update course set coursetime = #{courseTime},coursenumber = #{courseNumber},coursehour = #{courseHour} where id = #{id}")
    void updateCourseTime(@Param("courseTime") String courseTime,@Param("courseNumber") Integer courseNumber,@Param("courseHour") Integer courseHour,@Param("id") Integer id);


}
